#include "wx/wx.h"

#ifndef __BASEDEF_H__
#define __BASEDEF_H__

enum {
    RULETYPE_RECV=1,
    RULETYPE_SEND=2,
    RULETYPE_EVENT=4,
    RULETYPE_TIMER=8,
    RULETYPE_FINAL=16,
};

#define RULETYPE_ALL RULETYPE_RECV | RULETYPE_SEND | RULETYPE_EVENT | RULETYPE_TIMER | RULETYPE_FINAL

class CondDef{
public:
    CondDef(const wxString& n, int i, const wxString& d, int num, ...);    
    const wxString& GetName(){return name;};
    int GetParamCount(){return Params.size()/3;};
    int GetRuleMask(){ return UseInRuleType; };
    wxString GetCmdHelp(){
	return desc;
    }
    wxString GetParamHelp(int i){
	if (i*3 <= (int )Params.size()){
	    return Params[i*3+1];
	}
	return wxT("");
    }
    wxString GetValueDesc(int i){
	if (i*3 <= (int )Params.size()){
	    return Params[i*3+2];
	}
	return wxT("");
    }
    wxString GetParamName(int i){
	if (i*3 <= (int )Params.size()){
	    return Params[i*3];
	}
	return wxT("");
    }
protected:
    wxString name,desc;
    int UseInRuleType;
    wxArrayString Params;
};

typedef  CondDef ActionDef;


#endif
